<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
</head>
<style>
    html,
    body {
        background-color: #fff;
    }

    .placeholder_div {
        background-color: #fbf9f9;
    }

    .pharmacy {
        padding: 0 0.8rem;
    }

    .pharmacy .pharmacy_item {
        border: 1px solid #eaeaea;
        height: 4.5rem;
        width: 100%;
        margin-top: 1rem;
        border-radius: 0.5rem;
        position: relative;
    }

    .pharmacy_item .company_img {
        padding: 1rem;
        width: 3.7rem;
        height: 2.4rem;
    }

    .pharmacy_item .company_name {
        position: absolute;
        color: #303030;
        font-size: 0.7rem;
        left: 5.6rem;
        top: 0.85rem;
    }

    .pharmacy_item .detail {
        font-size: 0.6rem;
        color: #FD6251;
        position: absolute;
        right: 1rem;
        top: 0.85rem;
    }

    .pharmacy_item .tips {
        position: absolute;
        bottom: 1rem;
        left: 5.6rem;
    }

    .pharmacy_item .tips div {
        display: inline-block;
        font-size: 0.5rem;
        color: #838383;
        /* width: 2.5rem; */
        padding: 0 0.2rem;
        height: 1rem;
        text-align: center;
        line-height: 1.1rem;
        margin-right: 1rem;
        border: 1px solid #e8e8e8;
        border-radius: 0.2rem;
    }

    .pharmacy_item .tips div:last-child {
        margin: 0;
    }
</style>

<body>
    <div  id="app" v-cloak>
        <div class="placeholder_div"></div>

        <div class="pharmacy">
            <div class="pharmacy_item openwin" data-win="pharmacy_detail_win" :data-id="item.id" :data-title="item.name" v-for="item in data_list">
                <img class="company_img" :src=" IMAGE_HTTP + item.logo" alt="">
                <p class="company_name">{{item.name}}</p>
                <span class="detail">详情</span>
                <div class="tips">
                    <div class="tips_item">控股医药</div>
                    <div class="tips_item">华润集团</div>
                    <div class="tips_item">南方制药厂</div>
                </div>
            </div>
        </div>
    </div>
</body>

</html>
<script src="../script/set_root.js"></script>

<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/zepto.min.js"></script>
<script type="text/javascript" src="../script/hb.js"></script>
<script type="text/javascript" src="../script/vue.js"></script>
<script type="text/javascript">
    apiready = function () {
        hb_ready();

        getData() // 获取数据
    }
    //使用vue对数据进行绑定
    var app = new Vue({
        el: '#app',
        data: {
            page: 1,
            data_list: [], // 药房的数据
            IMAGE_HTTP:IMAGE_HTTP
        },
        methods: {

        },

    })

    function getData() {
        get_ajax("store/listpage", {
            start: app.page,
            pagesize: 10
        }, function (res, err) {
            // alert(JSON.stringify(res))
            if (res.code == 200) {
                app.data_list = res.data.data

                app.$nextTick(function () {
                    hb_init_openwinby_click();
                })
            } else {
                toast("网络不通畅，请稍后再试！")
            }

            if (err) {
                alert("网络不通畅，请稍后再试！")
            }
        })
    }
</script>